#! /bin/bash

# push many projects to oschinanet git repos.
# sync local and remote repos.

# ssh-key generated:
# 	ssh-kengen -t rsa -C "email@xxx.com"
#then,copy the public key to git-ware

# projects
TEST_DIR="$HOME/test/test-example"
SHELL_DIR="$HOME/work/shell-life"
ONVIF_DIR="$HOME/work/onvif/myonvif/onvif-server"
IPCSE_DIR="$HOME/work/ipc_search/ipc_search"
ZMDB_DIR="$HOME/work/zmipc/zmdb"

TEST_PRO="git@git.oschina.net:W-Matrix/test-example.git"
SHELL_PRO="git@git.oschina.net:W-Matrix/shell-life.git"
ONVIF_PRO="git@git.oschina.net:W-Matrix/onvif-server.git"
IPCSE_PRO="git@git.oschina.net:W-Matrix/ipc-search.git"
ZMDB_PRO="git@git.oschina.net:W-Matrix/zmdb.git"

# push once every week
BRANCH=master

pushd $TEST_DIR
git push $TEST_PRO $BRANCH 
popd

pushd $SHELL_DIR
git push $SHELL_PRO $BRANCH
popd

pushd $ONVIF_DIR
git push $ONVIF_PRO $BRANCH
popd

pushd $IPCSE_DIR
git push $IPCSE_PRO $BRANCH
popd

pushd $ZMDB_DIR
git push $ZMDB_PRO $BRANCH
popd

exit 0

